<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/10/30
  Time: 11:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page language
                 ="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>学生管理系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/styles.css">
</head>
<body class="body">
<div class="dingbu">
    <p>学生管理系统</p>
</div>
<div class="nav">
    <nav>
        <ul>
            <li><a href="index.jsp">首页</a></li>
            <li><a href="add.jsp">添加学生</a></li>
        </ul>
    </nav>
</div>
<div class="search">
    <form action="${pageContext.request.contextPath}/student/search" method="get">
        <label for="name">请输入姓名:</label>
        <input type="text" name="name" id="name" placeholder="输入姓名搜索">
        <input type="submit" value="查询">
    </form>
</div>
<div class="bd">
    <table border="1">
        <thead>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>性别</th>
            <th>邮箱</th>
            <th>手机号</th>
            <th colspan="2" style="text-align:center">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${students}" var="student">
            <tr>
                <td>${student.id}</td>
                <td>${student.name}</td>
                <td>${student.gender}</td>
                <td>${student.email}</td>
                <td>${student.phone}</td>
                <td style="text-align:center">
                    <a href="update.jsp?id=${student.id}">编辑</a>
                    <a href="delete.jsp?id=${student.id}" onclick="return confirm('确定删除吗？')">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
